package com.bw.mallshop.mvvm.viewmodel;

import com.blankj.utilcode.util.LogUtils;
import com.bw.mallshop.mvvm.model.BottomBtnModel;
import com.bw.mallshop.mvvm.model.entity.UserCenterEntity;
import com.bw.mvvm_common.entity.BaseEntity;
import com.bw.mvvm_common.mvvm.viewmodel.BaseViewModel;

import java.util.HashMap;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * @author KK
 * @description:
 * @date :2021/10/15 16:01
 */
public class BottomViewModel extends BaseViewModel<BottomBtnModel> {

    @Override
    public void oncreate() {
        super.oncreate();
        LogUtils.e("BottomViewModel"+"aaaaaaaaaaaaaaaaaaaa");
        requestBottomBtn();

    }

    public void requestBottomBtn(){
        HashMap<String,Object> map = new HashMap<>();
        map.put("imie","1");
        m.requestBottombtn(map).observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(this);


    }

    @Override
    protected void result(BaseEntity baseEntity) {
        //判断返回值状态是否请求成功
        if(baseEntity.getMessage().equals("imie为空")){
            showMsg(baseEntity.getMessage());
            return;
        }
        if(baseEntity.getMessage().equals("sign为空")){
            showMsg(baseEntity.getMessage());
            return;
        }
    }
}
